<template>
  <ant-modal
    modalWidth="576"
    modalHeight="500"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="12" >
          <a-form-model-item label="所属仓库" prop="warehouseId">
            <a-select
              placeholder="请选择所属仓库"
              v-model="form.warehouseId"
              :getPopupContainer="
                triggerNode => {
                  return triggerNode.parentNode || document.body
                }
              "
              style="width: 100%"
              allow-clear>
              <a-select-option v-for="(d, index) in warehouseIdOptions" :key="index" :value="d.id">{{ d.warehouseName }}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="面积" prop="area">
            <a-input v-model="form.area" placeholder="请输入面积"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="位置" prop="postion">
            <a-input v-model="form.postion" placeholder="请输入位置"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="排序" prop="sortNumber">
            <a-input-number v-model="form.sortNumber" :min="0" style="width: 100%"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="备注" prop="remark">
            <a-textarea v-model="form.remark" placeholder="请输入备注" :rows="4"/>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel">
        取消
      </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
        保存
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizWarehouseSpaceAddForm from './BizWarehouseSpaceForm'
export default {
  ...BizWarehouseSpaceAddForm
}
</script>
